import telebot
from  telebot import types 
import os
import database as db
import bot as BotWrapper

API = os.getenv('BOT_API')
bot = telebot.TeleBot(API)
database = db.Database('localhost', 'bot', os.getenv('PASSWORD_DB'))
myBot = BotWrapper.Bot(bot, database)

@bot.message_handler(content_types=['text'])
def get_text_messages(message):
    myBot.execute(message)

@bot.callback_query_handler(func=lambda call: True)
def callback_worker(call):
    myBot.answer(call)

bot.polling(none_stop=True, interval=0)